package com.jlect.swebing.ui.client;

/**
 * Base implementation of the event interface
 *
 * @author Sergey Kozmin
 * @since 26.11.2007 11:13:11
 */
public class BaseGEvent implements GEvent {
    private Object event;
    private int eventType;
    private GComponent source;
    private int modifier;

    public BaseGEvent(Object event, int eventType, GComponent source, int modifier) {
        init(event, eventType, source, modifier);
    }

    protected void init(Object event, int eventType, GComponent source, int modifier) {
        this.event = event;
        this.eventType = eventType;
        this.source = source;
        this.modifier = modifier;
    }

    public void setEvent(Object event) {
        this.event = event;
    }

    public void setEventType(int eventType) {
        this.eventType = eventType;
    }

    public void setSource(GComponent source) {
        this.source = source;
    }

    public Object getInitial() {
        return event;
    }

    public int getEventType() {
        return eventType;
    }

    public GComponent getSource() {
        return source;
    }

    public int getModifiers() {
        return modifier;
    }

    public void setModifier(int modifier) {
        this.modifier = modifier;
    }

    public String toString() {
        return "BaseGEvent{" +
                "event=" + event +
                ", eventType=" + eventType +
                ", source=" + source +
                ", modifier=" + modifier +
                '}';
    }
}
